@echo off
set SELFPATH=%~dp0
echo | set /p="Waiting for DFU Device";
:loop
echo | set /p="."
for /f %%i in ('%SELFPATH%\dfu-util.exe -l ^| findstr "Found DFU"') do set OUTPUT=%%i
if "%OUTPUT%" == "" goto loop
echo "Gotcha!"
%SELFPATH%\bin\dfu-util.exe -R -a all -D output\images\sysimage-sdcard.img
@REM %SELFPATH%\bin\dfu-util -a u-boot -D output\images\u-boot-sunxi-with-spl.bin
@REM %SELFPATH%\bin\dfu-util -a boot -D output\images\bootfs.vfat
@REM %SELFPATH%\bin\dfu-util -a rom -D output\images\rootfs.ext4
@REM %SELFPATH%\bin\dfu-util -a devicetree.dtb -D output\images\devicetree.dtb
@REM %SELFPATH%\bin\dfu-util -a zImage -D output\images\zImage
